<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <ul id="ul1">
    <li>测试信息&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">隐藏</a></li>
    <li>测试信息&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">隐藏</a></li>
    <li>测试信息&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">隐藏</a></li>
    <li>测试信息&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">隐藏</a></li>
  </ul>

  <script>
    let ul1 = document.getElementById("ul1")
    //获取父节点
    console.log(ul1.parentNode);
    let aTags = ul1.getElementsByTagName("a")
    for (let i = 0; i < aTags.length; i++) {
      aTags[i].onclick = function () {
        let parNode = aTags[i].parentNode
        parNode.style.display = "none"
      }

    }


  </script>

</body>

</html>